package com.teaclipse.presentation;

import javax.swing.JTextArea;
import javax.swing.text.Document;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.Writer;
import javax.swing.JTextPane;
import java.io.PrintStream;
import java.awt.Color;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class CompilerProblemFrame extends PrintStream
{
    private JTextPane theTextPane = null;

    public CompilerProblemFrame(OutputStream out,JTextPane theTextArea)
    {
        super(out);
        this.theTextPane = theTextArea;
        theTextPane.setForeground(Color.RED);
    }

    public void print(Object obj)
    {
        print(obj.toString());
    }

    public void print(String str)
    {
        theTextPane.setText(theTextPane.getText() + str);
    }

    public void println(Object obj)
    {
      println(obj.toString());
    }
    public void println(String str)
    {
         theTextPane.setText(theTextPane.getText() + str + "\n");
    }

}
